package com.qianfeng.exam.pojo;


import com.alibaba.druid.util.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;


//@JsonInclude(JsonInclude.Include.NON_NULL)//null值属性不输出
public class Authors {

  private Long authorid;
  private String authorName;
  private String authorDescription;
  @JsonIgnore
  private Long datastatus;

  @JsonIgnore
  public boolean isNull() {
    if (authorid == null){//没有传id 说明是在新增
      return StringUtils.isEmpty(authorName);
    }else {
      //新增的时候可以用,因为修改的时候用户该不了id,不会传值过来
      return StringUtils.isEmpty(authorName);
    }
  }

  public Long getAuthorid() {
    return authorid;
  }

  public void setAuthorid(Long authorid) {
    this.authorid = authorid;
  }

  public String getAuthorName() {
    return authorName;
  }

  public void setAuthorName(String authorName) {
    this.authorName = authorName;
  }

  public String getAuthorDescription() {
    return authorDescription;
  }

  public void setAuthorDescription(String authorDescription) {
    this.authorDescription = authorDescription;
  }

  public Long getDatastatus() {
    return datastatus;
  }

  public void setDatastatus(Long datastatus) {
    this.datastatus = datastatus;
  }

  @Override
  public String toString() {
    return "Authors{" +
            "authorid=" + authorid +
            ", authorName='" + authorName + '\'' +
            ", authorDescription='" + authorDescription + '\'' +
            ", datastatus=" + datastatus +
            '}';
  }
}
